package net.dgg.zz.credential.warningConfigure.constant;

/**
 * @author zsx
 * @Title: WarningType
 * @ProjectName zzsc
 * @Description: TODO
 * @date 2018/8/16 15:05
 */
public enum WarningType {
    CAPITAL_POOL_WARNING("CAPITAL_POOL_WARNING", "capital_pool_warning"),//资金池预警值
    STORAGE_WARNING("STORAGE_WARNING", "storage_warning"),//库容预警值
    CERTIFICATE_EXPIRE_WARNING("CERTIFICATE_EXPIRE_WARNING", "certificate_expire_warning"),//过期预警值
    CERTIFICATE_HANG_UP_WARNING("CERTIFICATE_HANG_UP_WARNING", "certificate_hang_up_warning"),//证书使用预警值
    CERTIFICATE_NOT_USED_WARNING("CERTIFICATE_NOT_USED_WARNING", "certificate_not_used_warning"),//证书未使用预警值
    TALENT_CONTRACT_WARNING("TALENT_CONTRACT_WARNING", "talent_contract_warning"),//人才合同到期预警值
    COMPANY_CONTRACT_WARNING("COMPANY_CONTRACT_WARNING", "company_contract_warning"),//企业合同到期预警值
    REVIEW_PROGRESSION("REVIEW_PROGRESSION", "review_progression");//审核级数
    private String code;
    private String fieldName;

    private WarningType(String name, String fieldName) {
        this.code = name;
        this.fieldName = fieldName;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public static String getNameByFieldName(String code) {
        WarningType[] warningTypes = WarningType.values();
        for (WarningType warningType : warningTypes) {
            if (warningType.getCode().equals(code)) {
                return warningType.getFieldName();
            }
        }
        return "";
    }
}
